#include <iostream>
#include <fstream>
#include"httpServer.hpp"
using namespace std;
class Unit
{
public:
    static string Getline(string &buffer,const string &sep)
    {
        auto pos = buffer.find(sep);
        if(pos == string::npos)
        {
            cout<<"无法获得第一行"<<endl;
            return " ";
        }
        string ret = buffer.substr(0,pos);
        buffer.erase(0,pos);
        return ret;
    }
    static bool Readfile(const string &path,char*buffer,int size)
    {
        ifstream in(path,ios::binary);
        if(!in.is_open())
        return false;
        in.read(buffer,size);
        in.close();
        return true;
    }
};